package com.yan.demo;

/**
 * @author taoge
 * @Date 2024/7/31 11:00
 * @Description
 */
public class Student1{
    private String name;
    private Integer age;
    private Double score;

    public Student1(String name, Integer age, Double score) {
        this.name = name;
        this.age = age;
        this.score = score;
    }

    public Student1() {

    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Double getScore() {
        return score;
    }

    public void setScore(Double score) {
        this.score = score;
    }

    @Override
    public String toString() {
        return "Stduent{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", score=" + score +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Student1 stduent = (Student1) o;

        if (name != null ? !name.equals(stduent.name) : stduent.name != null) return false;
        if (age != null ? !age.equals(stduent.age) : stduent.age != null) return false;
        return score != null ? score.equals(stduent.score) : stduent.score == null;
    }

    @Override
    public int hashCode() {
        int result = name != null ? name.hashCode() : 0;
        result = 31 * result + (age != null ? age.hashCode() : 0);
        result = 31 * result + (score != null ? score.hashCode() : 0);
        return result;
    }
}
